import java.util.function.Function;

/**
 * @ClassName Demo12
 * @Description TODO
 * @Author Li
 * @Date 2022/8/14 15:14
 * @ModifyDate 2022/8/14 15:14
 * @Version 1.0
 */
public class Demo12 {
    private static void method(Function<String, Integer> fun1,
                               Function<Integer, String> fun2) {
        String s = fun1.andThen(fun2).apply("HelloWorld");
        System.out.println(s);
    }

    public static void main(String[] args) {
        method(s -> s.indexOf("W") + 1,
                i -> new String("W出现在该字符的第" + i + "位上！"));
    }
}
